package org.example.helloworld.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.example.helloworld.entity.ElcPri;
import org.example.helloworld.entity.WaPrice;
import org.example.helloworld.mapper.ElcPriMapper;
import org.example.helloworld.mapper.WaPriceMapper;
import org.example.helloworld.service.IWaPriceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 水费价格 服务实现类
 * </p>
 *
 * @author cwf
 * @since 2024-07-10
 */
@Service
public class WaPriceServiceImpl extends ServiceImpl<WaPriceMapper, WaPrice> implements IWaPriceService {

    @Autowired
    private WaPriceMapper waPriceMapper;

    @Override
    public IPage<WaPrice> getWaPriceList(Page<WaPrice> page, String search) {
        QueryWrapper<WaPrice> queryWrapper = new QueryWrapper<>();
        if (search != null && !search.isEmpty()) {
            queryWrapper.like("stemp", search);
        }
        return waPriceMapper.selectPage(page, queryWrapper);
    }
}
